import express from 'express'
import dotenv from 'dotenv'
import routes from './routes/index.js'
import cors from 'cors'

dotenv.config();

const app =express();
const PORT=process.env.PORT || 3001;

app.use(cors());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(routes);

app.listen(PORT,function(){
    console.log(`服务器运行在 http://localhost:${PORT}`)
})

export default app